import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);
const router = new Router({
  mode: "history",
  routes: [
    {
      path: '', //链接路径
      component: () => import('../index.vue')
    },
    {
      path: '/record', //链接路径
      component: () => import('../record.vue')
    }
  ]
});
// 解决重复点击导航时，控制台出现报错
const VueRouterPush = Router.prototype.push;
Router.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch((err) => err);
};
router.beforeEach((to, from, next) => {
  next()
});
export default router;
